package com.daisuxia.web.util;

import java.util.HashMap;
import java.util.Map;

import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.springframework.beans.factory.annotation.Autowired;

import com.daisuxia.back.service.ITongBuService;


public class QueueMessageListener implements MessageListener {
	
	
	@Autowired
	ITongBuService tongBuService;

	@Override
	public void onMessage(Message message) {
		MapMessage  tm = (MapMessage) message;
		 try {
			/* Map<String, Object> map = new HashMap<String, Object>();
			 JmsConsumer js = new JmsConsumer();
			 map.put("repayId", tm.getString("repayId"));
			 map.put("type", tm.getString("type"));
			 js.send(map);*/
			 tongBuService.tongbu(tm.getString("repayId"),  tm.getString("type"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
	}
	


}
